package kr.co.graviti.adm.bbs.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import kr.co.graviti.common.action.BaseFuncAction;
import kr.co.graviti.common.util.CommonUtil;

public class AdmBbsModifyFormAction extends BaseFuncAction {
	private static final Logger _log = Logger
			.getLogger(AdmBbsModifyFormAction.class);

	/**
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	public ActionForward notice(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		
		_log.info("modiry Form start");
		boolean _result = new AdmBbsReadAction().boardRead(request, response);
		String returnfoward = "";
		if (_result) {
			returnfoward = CommonUtil.strNullChk(request
					.getParameter("board_type"));
		} else {
			returnfoward = "fail";
		}

		return mapping.findForward(returnfoward);
	}
	
	public ActionForward news(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		
		_log.info("modiry Form start");
		boolean _result = new AdmBbsReadAction().boardRead(request, response);
		String returnfoward = "";
		if (_result) {
			returnfoward = CommonUtil.strNullChk(request
					.getParameter("board_type"));
		} else {
			returnfoward = "fail";
		}

		return mapping.findForward(returnfoward);
	}
}
